﻿package plugin.roletwo
{
    import com.core.*;
    import com.sh.game.global.*;
    import com.sh.game.util.*;
    import flash.display.*;
    import flash.events.*;
    import flash.geom.*;
    import morn.core.components.*;
    import morn.core.events.*;
    import plugin.component.*;
    import uiresource.roleui.*;
    import vo.*;

    public class RoletwoCtrl extends RoleTwoUI
    {
        private var _role:Roletwo;
        private var _roleData:Object;
        private var otherfashion:Object = null;
        private var otherSkills:Object = null;
        private var _armsArr:Object;
        public var _vipatt:Number = 0;
        public var _vipattstr:Number = 0;
        private var _baseability:Object;
        private var _buffability:Object;
        private var _curimg:String = null;
        private var rolehead:Image;
        private var cfgitem:Object;
        private var role:SimpleRoleManager;
        private var _qhArr:Array;
        private var _qhtzTips:String;
        private var _jdtzTips:String;
        private var _bstzTips:String;
        private var _roleContainer:Container;
        private var _tabIndex:Array;
        private var oldPower:int = 0;
        private var qhtz:Object;
        private var jdtz:Object;
        private var bstz:Object;
        private var roleLevel:int = 0;
        private var roleRein:int = 0;
        private var rein:int = 0;
        private static const HEAD_URL:String = "assets/images/head/";

        public function RoletwoCtrl(param1:Roletwo)
        {
            this._qhArr = [1, 2, 9, 3, 10, 4, 5, 6, 7, 8, 15, 13, 12];
            this._tabIndex = [1, 2, 4, 5, 3];
            this.qhtz = ConfigDictionary.data.qhtz;
            this.jdtz = ConfigDictionary.data.jdtz;
            this.bstz = ConfigDictionary.data.bstz;
            this._role = param1;
            return;
        }// end function

        override protected function createChildren() : void
        {
            viewClassMap["uiresource.roleui.Armitem2UI"] = Armitem2Ctrl;
            loadUI("RoleTwo.xml");
            return;
        }// end function

        override protected function initializeView() : void
        {
            super.initializeView();
            this.init();
            this.initEvent();
            return;
        }// end function

        private function initEvent() : void
        {
            titleimg.addEventListener(UIEvent.IMAGE_LOADED, this.titleLoaded);
            close_btn.addEventListener(MouseEvent.CLICK, this.close);
            var _loc_1:int = 1;
            while (_loc_1 <= 20)
            {
                
                if (this.hasOwnProperty("_Arm" + _loc_1))
                {
                    (this["_Arm" + _loc_1] as Armitem2Ctrl).addEventListener(MouseEvent.ROLL_OVER, this.onOver);
                }
                _loc_1++;
            }
            return;
        }// end function

        protected function onOver(event:MouseEvent) : void
        {
            var _loc_2:* = event.currentTarget as Armitem2Ctrl;
            if (!_loc_2 || _loc_2.data == null)
            {
                return;
            }
            this.removeEventListener(MouseEvent.MOUSE_OVER, this.onOver);
            if (_loc_2.data.itemtype == 1)
            {
                ModelProxy.change("tips", "arm", {data:[_loc_2.data, this._armsArr], p:new Point(GlobalLayer.instance.flashStage.mouseX, GlobalLayer.instance.flashStage.mouseY)});
            }
            this.addEventListener(MouseEvent.MOUSE_OUT, this.onOut);
            return;
        }// end function

        protected function onOut(event:MouseEvent) : void
        {
            this.removeEventListener(MouseEvent.MOUSE_OUT, this.onOut);
            ModelProxy.change("tips", "state", "close");
            this.addEventListener(MouseEvent.MOUSE_OVER, this.onOver);
            return;
        }// end function

        protected function titleLoaded(event:UIEvent) : void
        {
            titleimg.x = (-titleimg.width) / 2;
            return;
        }// end function

        protected function init() : void
        {
            var _loc_2:Sprite = null;
            var _loc_1:* = new Sprite();
            addChild(_loc_1);
            _loc_1.graphics.beginFill(16777215, 0);
            _loc_1.graphics.drawRect(0, 0, 70, 150);
            _loc_1.x = 85;
            _loc_1.y = 58;
            _loc_1.addEventListener(MouseEvent.ROLL_OVER, this.spRollOverHandler);
            _loc_1.addEventListener(MouseEvent.ROLL_OUT, this.spRollOutHandler);
            _loc_2 = new Sprite();
            addChild(_loc_2);
            _loc_2.graphics.beginFill(16777215, 0);
            _loc_2.graphics.drawRect(0, 0, 70, 150);
            _loc_2.x = 145;
            _loc_2.y = 140;
            _loc_2.addEventListener(MouseEvent.ROLL_OVER, this.sp2RollOverHandler);
            _loc_2.addEventListener(MouseEvent.ROLL_OUT, this.spRollOutHandler);
            this._roleContainer = new Container();
            leftbox.addChildAt(this._roleContainer, 1);
            this._roleContainer.mouseChildren = false;
            this._roleContainer.mouseEnabled = false;
            this._roleContainer.x = 284;
            this._roleContainer.y = 331;
            this.rolehead = new Image();
            this.rolehead.x = 3;
            this.rolehead.y = 395;
            addChild(this.rolehead);
            var _loc_3:* = new Sprite();
            _loc_3.graphics.beginFill(16777215, 1);
            _loc_3.graphics.drawCircle(0, 0, 34);
            _loc_3.graphics.endFill();
            _loc_3.x = 52;
            _loc_3.y = 436;
            addChild(_loc_3);
            this.rolehead.mask = _loc_3;
            return;
        }// end function

        protected function sp2RollOverHandler(event:MouseEvent) : void
        {
            var _loc_2:Object = null;
            if (_Arm5 && (_Arm5 as Armitem2Ctrl).data)
            {
                if (int((_Arm5 as Armitem2Ctrl).data.itemid) <= 0)
                {
                    return;
                }
                _loc_2 = ItemObject.create((_Arm5 as Armitem2Ctrl).data);
                _loc_2.wear = 0;
                ModelProxy.change("tips", "arm", {data:_loc_2, p:new Point(GlobalLayer.instance.root.mouseX, GlobalLayer.instance.root.mouseY)});
            }
            return;
        }// end function

        protected function spRollOverHandler(event:MouseEvent) : void
        {
            var _loc_2:Object = null;
            if (_Arm1 && (_Arm1 as Armitem2Ctrl).data)
            {
                if (int((_Arm1 as Armitem2Ctrl).data.itemid) <= 0)
                {
                    return;
                }
                _loc_2 = ItemObject.create((_Arm1 as Armitem2Ctrl).data);
                _loc_2.wear = 0;
                ModelProxy.change("tips", "arm", {data:_loc_2, p:new Point(GlobalLayer.instance.root.mouseX, GlobalLayer.instance.root.mouseY)});
            }
            return;
        }// end function

        protected function spRollOutHandler(event:MouseEvent) : void
        {
            ModelProxy.change("tips", "state", "close");
            return;
        }// end function

        protected function close(event:MouseEvent) : void
        {
            this._role.close();
            return;
        }// end function

        public function openRefresh(param1:Object) : void
        {
            if (!param1)
            {
                return;
            }
            this._roleData = param1.role;
            this._armsArr = param1.arms;
            this.otherfashion = param1.fashion;
            this.otherSkills = param1.skills;
            ModelProxy.change("data", "otheruser", this._roleData);
            var _loc_2:* = param1.vip;
            var _loc_3:int = 1;
            while (_loc_3 <= 20)
            {
                
                if (this._armsArr[_loc_3])
                {
                    this._armsArr[_loc_3].pos = _loc_3;
                }
                _loc_3++;
            }
            this._baseability = this._roleData.ability;
            this._buffability = this._roleData.abilityBuf;
            this.updatePro();
            this.updateUser(this._roleData);
            var _loc_4:* = this._roleData.career + "_" + this._roleData.sex;
            if (this._curimg != _loc_4)
            {
                this._curimg = _loc_4;
                this.rolehead.url = Config.getUrl(HEAD_URL + _loc_4 + ".png");
            }
            this.updateArm();
            var _loc_5:Object = null;
            _loc_5 = param1.role;
            _loc_5.arms = param1.arms;
            _loc_5.fashions = param1.fashion;
            this.updateviptxt(param1.vip);
            this.addRoleView(_loc_5);
            if (!this.cfgitem)
            {
                this.cfgitem = ConfigDictionary.data.item;
            }
            this.showArmTZTips();
            return;
        }// end function

        private function tbHandler(param1:int) : void
        {
            switch(param1)
            {
                case 1:
                {
                    rolelabel.text = "人物属性";
                    if (this._roleContainer)
                    {
                        this._roleContainer.visible = true;
                    }
                    break;
                }
                default:
                {
                    break;
                }
            }
            return;
        }// end function

        public function showArmTZTips() : void
        {
            var _loc_3:String = null;
            var _loc_12:String = null;
            var _loc_13:int = 0;
            var _loc_14:Object = null;
            var _loc_17:String = null;
            var _loc_19:int = 0;
            var _loc_20:Object = null;
            var _loc_21:Object = null;
            var _loc_22:Object = null;
            var _loc_23:int = 0;
            var _loc_24:int = 0;
            var _loc_25:Array = null;
            var _loc_26:int = 0;
            var _loc_27:int = 0;
            var _loc_28:Array = null;
            var _loc_29:int = 0;
            var _loc_30:int = 0;
            var _loc_31:int = 0;
            var _loc_32:int = 0;
            var _loc_33:int = 0;
            var _loc_34:int = 0;
            var _loc_1:* = this._armsArr;
            var _loc_2:* = new Object();
            var _loc_4:Array = [];
            var _loc_5:Array = [];
            var _loc_6:* = "<font color=\'#" + MColor.Newstr6 + "\' size=\'14\'>强化效果加成</font>\n";
            var _loc_7:* = "<font color=\'#" + MColor.Newstr6 + "\' size=\'14\'>传说鉴定加成</font>\n";
            var _loc_8:int = 0;
            var _loc_9:int = 1;
            while (_loc_9 <= 15)
            {
                
                _loc_22 = _loc_1[_loc_9];
                if (_loc_22)
                {
                    _loc_23 = _loc_22.superlevel;
                    if (_loc_23 > 0)
                    {
                        _loc_24 = 1;
                        while (_loc_24 <= _loc_23)
                        {
                            
                            _loc_2[_loc_24] = int(_loc_2[_loc_24]) + 1;
                            _loc_24++;
                        }
                    }
                    if (_loc_22.suitid == 1 || _loc_22.suitid == 3)
                    {
                        if (_loc_22.appraisal)
                        {
                            _loc_25 = _loc_22.appraisal;
                            _loc_26 = 0;
                            while (_loc_26 < _loc_25.length)
                            {
                                
                                _loc_27 = _loc_25[_loc_26] >> 20;
                                if (_loc_27 > 0)
                                {
                                    _loc_4[_loc_27] = int(_loc_4[_loc_27]) + 1;
                                }
                                _loc_26++;
                            }
                        }
                        if (_loc_22.xq)
                        {
                            _loc_28 = _loc_22.xq;
                            _loc_29 = 0;
                            for each (_loc_30 in _loc_28)
                            {
                                
                                if (this.cfgitem[_loc_30])
                                {
                                    _loc_5[int(this.cfgitem[_loc_30].level)] = int(_loc_5[int(this.cfgitem[_loc_30].level)]) + 1;
                                }
                            }
                        }
                    }
                }
                _loc_9++;
            }
            var _loc_10:Object = null;
            var _loc_11:Object = null;
            for each (_loc_14 in this.qhtz)
            {
                
                _loc_31 = 2;
                if (_loc_2[_loc_14.lv] >= _loc_14.count)
                {
                    _loc_31 = 8;
                    if (_loc_8 < _loc_14.lv)
                    {
                        _loc_8 = _loc_14.lv;
                    }
                    if (_loc_11 == null)
                    {
                        _loc_11 = new Object();
                    }
                    _loc_11.count = _loc_14.count;
                    _loc_11.lv = _loc_14.lv;
                    for (_loc_12 in _loc_14)
                    {
                        
                        if (_loc_12 == "id" || _loc_12 == "count" || _loc_12 == "lv")
                        {
                            continue;
                        }
                        if (_loc_11[_loc_12] == null)
                        {
                            _loc_11[_loc_12] = 0;
                        }
                        _loc_11[_loc_12] = _loc_11[_loc_12] + int(_loc_14[_loc_12]);
                    }
                    continue;
                }
                if (_loc_10 == null)
                {
                    _loc_10 = new Object();
                    for (_loc_12 in _loc_14)
                    {
                        
                        if (_loc_12 == "id" || _loc_12 == "count" || _loc_12 == "lv")
                        {
                            _loc_10[_loc_12] = int(_loc_14[_loc_12]);
                            continue;
                        }
                        if (_loc_11)
                        {
                            _loc_10[_loc_12] = int(_loc_11[_loc_12]) + int(_loc_14[_loc_12]);
                            continue;
                        }
                        _loc_10[_loc_12] = int(_loc_14[_loc_12]);
                    }
                    break;
                }
            }
            _loc_6 = _loc_6 + MColor.getHMTL("\n当前效果:\n", 11);
            if (_loc_11 == null)
            {
                _loc_6 = _loc_6 + MColor.getHMTL("无:\n", 1);
            }
            else
            {
                _loc_6 = _loc_6 + MColor.getHMTL(_loc_11.count + "件装备强" + _loc_11.lv, 4);
                _loc_6 = _loc_6 + ("<font color=\'#00ff00\'>  (" + int(_loc_2[_loc_11.lv]) + "/" + _loc_11.count + ")</font>" + MColor.getHMTL("(激活)", 2) + "\n");
                _loc_6 = _loc_6 + this.getInfo(_loc_11, 5);
            }
            if (_loc_10)
            {
                _loc_6 = _loc_6 + MColor.getHMTL("\n下级效果:\n", 11);
                _loc_6 = _loc_6 + MColor.getHMTL(_loc_10.count + "件装备强" + _loc_10.lv, 4);
                _loc_6 = _loc_6 + ("<font color=\'#ff0000\'>  (" + int(_loc_2[_loc_10.lv]) + "/" + _loc_10.count + ")</font>" + MColor.getHMTL("(未激活)", 2) + "\n");
                _loc_32 = 0;
                for each (_loc_33 in this._qhArr)
                {
                    
                    _loc_32++;
                    if (_loc_32 == 8)
                    {
                        _loc_6 = _loc_6 + "\n";
                    }
                    else if (_loc_32 != 1)
                    {
                        _loc_6 = _loc_6 + " ";
                    }
                    if (_loc_1[_loc_33] && _loc_1[_loc_33].superlevel >= _loc_10.lv)
                    {
                        _loc_6 = _loc_6 + MColor.getHMTL(_loc_1[_loc_33].leixing, 7);
                        continue;
                    }
                    if (_loc_1[_loc_33])
                    {
                        _loc_6 = _loc_6 + MColor.getHMTL(_loc_1[_loc_33].leixing, 2);
                        continue;
                    }
                    _loc_6 = _loc_6 + MColor.getHMTL(UIGlobel.getPosName(_loc_33), 2);
                }
                _loc_6 = _loc_6 + "\n";
                _loc_6 = _loc_6 + this.getInfo(_loc_10, 5);
            }
            this._qhtzTips = _loc_6;
            if (_loc_8 > 0)
            {
                _loc_3 = _loc_8.toString();
                _loc_13 = 0;
                while (_loc_13 < _loc_3.length)
                {
                    
                    if (_loc_3.length == 1)
                    {
                    }
                    _loc_13++;
                }
            }
            var _loc_15:Object = null;
            var _loc_16:Object = null;
            var _loc_18:int = 0;
            for each (_loc_21 in this.jdtz)
            {
                
                _loc_34 = 2;
                _loc_19 = 0;
                for (_loc_20 in _loc_4)
                {
                    
                    if (_loc_20 >= _loc_21.lv)
                    {
                        _loc_19 = _loc_19 + _loc_4[_loc_20];
                    }
                }
                if (_loc_19 >= _loc_21.count)
                {
                    _loc_18 = _loc_21.id;
                    _loc_34 = 8;
                    if (_loc_16 == null)
                    {
                        _loc_16 = new Object();
                    }
                    _loc_16.count = _loc_21.count;
                    _loc_16.lv = _loc_21.lv;
                    for (_loc_17 in _loc_21)
                    {
                        
                        if (_loc_17 == "id" || _loc_17 == "count" || _loc_17 == "lv")
                        {
                            continue;
                        }
                        if (_loc_16[_loc_17] == null)
                        {
                            _loc_16[_loc_17] = 0;
                        }
                        _loc_16[_loc_17] = _loc_16[_loc_17] + int(_loc_21[_loc_17]);
                    }
                    continue;
                }
                if (_loc_15 == null)
                {
                    _loc_15 = new Object();
                    for (_loc_17 in _loc_21)
                    {
                        
                        if (_loc_17 == "id" || _loc_17 == "count" || _loc_17 == "lv")
                        {
                            _loc_15[_loc_17] = int(_loc_21[_loc_17]);
                            continue;
                        }
                        if (_loc_16)
                        {
                            _loc_15[_loc_17] = int(_loc_16[_loc_17]) + int(_loc_21[_loc_17]);
                            continue;
                        }
                        _loc_15[_loc_17] = int(_loc_21[_loc_17]);
                    }
                    break;
                }
            }
            _loc_7 = _loc_7 + MColor.getHMTL("\n当前效果:\n", 11);
            if (_loc_16 == null)
            {
                _loc_7 = _loc_7 + MColor.getHMTL("无:\n", 1);
            }
            else
            {
                _loc_7 = _loc_7 + MColor.getHMTL(_loc_16.count + "条" + _loc_16.lv + "星以上鉴定属性激活", 4);
                _loc_7 = _loc_7 + ("<font color=\'#00ff00\'>  (" + _loc_16.count + "/" + _loc_16.count + ")</font>" + MColor.getHMTL("(激活)", 2) + "\n");
                _loc_7 = _loc_7 + this.getInfo1(_loc_16, 5);
            }
            if (_loc_15)
            {
                _loc_7 = _loc_7 + MColor.getHMTL("\n下级效果:\n", 11);
                _loc_7 = _loc_7 + MColor.getHMTL(_loc_15.count + "条" + _loc_15.lv + "星以上", 4);
                _loc_19 = 0;
                for (_loc_20 in _loc_4)
                {
                    
                    if (_loc_20 >= _loc_15.lv)
                    {
                        _loc_19 = _loc_19 + _loc_4[_loc_20];
                    }
                }
                _loc_7 = _loc_7 + ("<font color=\'#ff0000\'>  (" + _loc_19 + "/" + _loc_15.count + ")</font>" + MColor.getHMTL("(未激活)", 2) + "\n");
                _loc_7 = _loc_7 + this.getInfo1(_loc_15, 5);
            }
            this._jdtzTips = _loc_7;
            if (_loc_18 > 0)
            {
                _loc_3 = _loc_18.toString();
                _loc_13 = 0;
                while (_loc_13 < _loc_3.length)
                {
                    
                    if (_loc_3.length == 1)
                    {
                    }
                    _loc_13++;
                }
            }
            this.getBstz(_loc_5);
            return;
        }// end function

        public function addRoleView(param1:Object) : void
        {
            if (this.role)
            {
                this.role.updateRoel(param1);
            }
            else
            {
                this.role = new SimpleRoleManager(param1, this._roleContainer);
            }
            return;
        }// end function

        public function UpdateAbility(param1:int) : void
        {
            this.oldPower = param1;
            return;
        }// end function

        private function getBstz(param1:Array) : void
        {
            var _loc_4:String = null;
            var _loc_6:Object = null;
            var _loc_7:Object = null;
            var _loc_8:String = null;
            var _loc_9:int = 0;
            var _loc_10:int = 0;
            var _loc_11:int = 0;
            var _loc_12:String = null;
            var _loc_13:int = 0;
            var _loc_2:Object = null;
            var _loc_3:Object = null;
            var _loc_5:int = 0;
            for each (_loc_7 in this.bstz)
            {
                
                _loc_9 = 2;
                _loc_10 = 0;
                for (_loc_6 in param1)
                {
                    
                    if (_loc_6 >= _loc_7.lv)
                    {
                        _loc_10 = _loc_10 + param1[_loc_6];
                    }
                }
                if (_loc_10 >= _loc_7.count)
                {
                    _loc_5 = _loc_7.id;
                    _loc_9 = 8;
                    if (_loc_3 == null)
                    {
                        _loc_3 = new Object();
                    }
                    _loc_3.count = _loc_7.count;
                    _loc_3.lv = _loc_7.lv;
                    for (_loc_4 in _loc_7)
                    {
                        
                        if (_loc_4 == "id" || _loc_4 == "count" || _loc_4 == "lv")
                        {
                            continue;
                        }
                        if (_loc_3[_loc_4] == null)
                        {
                            _loc_3[_loc_4] = 0;
                        }
                        _loc_3[_loc_4] = _loc_3[_loc_4] + int(_loc_7[_loc_4]);
                    }
                    continue;
                }
                if (_loc_2 == null)
                {
                    _loc_2 = new Object();
                    for (_loc_4 in _loc_7)
                    {
                        
                        if (_loc_4 == "id" || _loc_4 == "count" || _loc_4 == "lv")
                        {
                            _loc_2[_loc_4] = int(_loc_7[_loc_4]);
                            continue;
                        }
                        if (_loc_3)
                        {
                            _loc_2[_loc_4] = int(_loc_3[_loc_4]) + int(_loc_7[_loc_4]);
                            continue;
                        }
                        _loc_2[_loc_4] = int(_loc_7[_loc_4]);
                    }
                    break;
                }
            }
            _loc_8 = "<font color=\'#" + MColor.Newstr6 + "\' size=\'14\'>传说/传奇套装镶嵌加成</font>\n";
            _loc_8 = _loc_8 + MColor.getHMTL("\n当前效果:\n", 11);
            if (_loc_3 == null)
            {
                _loc_8 = _loc_8 + MColor.getHMTL("无:\n", 1);
            }
            else
            {
                _loc_8 = _loc_8 + MColor.getHMTL(_loc_3.count + "颗" + _loc_3.lv + "级宝石", 4);
                _loc_8 = _loc_8 + ("<font color=\'#00ff00\'>  (" + _loc_3.count + "/" + _loc_3.count + ")</font>" + MColor.getHMTL("(激活)", 2) + "\n");
                _loc_8 = _loc_8 + this.getInfo1(_loc_3, 5);
            }
            if (_loc_2)
            {
                _loc_8 = _loc_8 + MColor.getHMTL("\n下级效果:\n", 11);
                _loc_8 = _loc_8 + MColor.getHMTL(_loc_2.count + "颗" + _loc_2.lv + "级宝石激活", 4);
                _loc_11 = 0;
                for (_loc_6 in param1)
                {
                    
                    if (_loc_6 >= _loc_2.lv)
                    {
                        _loc_11 = _loc_11 + param1[_loc_6];
                    }
                }
                _loc_8 = _loc_8 + ("<font color=\'#ff0000\'>  (" + _loc_11 + "/" + _loc_2.count + ")</font>" + MColor.getHMTL("(未激活)", 2) + "\n");
                _loc_8 = _loc_8 + this.getInfo1(_loc_2, 5);
            }
            this._bstzTips = _loc_8;
            if (_loc_5 > 0)
            {
                _loc_12 = _loc_5.toString();
                _loc_13 = 0;
                while (_loc_13 < _loc_12.length)
                {
                    
                    if (_loc_12.length == 1)
                    {
                    }
                    _loc_13++;
                }
            }
            return;
        }// end function

        public function updateArm() : void
        {
            var _loc_1:int = 1;
            while (_loc_1 <= 20)
            {
                
                if (this["_Arm" + _loc_1] && this["_Arm" + _loc_1] as Armitem2Ctrl)
                {
                    if (!this._armsArr[_loc_1])
                    {
                        this._armsArr[_loc_1] = new Object();
                    }
                    this._armsArr[_loc_1].pos = _loc_1;
                    (this["_Arm" + _loc_1] as Armitem2Ctrl).data = this._armsArr[_loc_1];
                }
                _loc_1++;
            }
            return;
        }// end function

        public function updateUser(param1:Object = null) : void
        {
            var _loc_2:Image = null;
            if (param1 == null)
            {
                param1 = UserData.getUserData();
            }
            if (UIGlobel.getCareer(param1.career) == "法师")
            {
                if (UIGlobel.getCareer(param1.career) == "道士")
                {
                    if (UIGlobel.getCareer(param1.career) == "战士")
                    {
                        _loc_2 = getChildByName("img_head") as Image;
                    }
                }
            }
            this.rein = param1.rein;
            this.roleLevel = param1.level;
            _levelNum.text = String(this.roleLevel);
            this.roleRein = param1.rein;
            return;
        }// end function

        private function updateviptxt(param1:int) : void
        {
            if (param1 > 0)
            {
                vip_txt.visible = true;
                vip_txt.text = "vip";
            }
            else
            {
                vip_txt.visible = false;
            }
            return;
        }// end function

        public function updatePro() : void
        {
            if (!this._baseability)
            {
                return;
            }
            if (!this._baseability.hasOwnProperty("hp"))
            {
                this._baseability.hp = this._baseability.maxHp;
            }
            if (!this._baseability.hasOwnProperty("mp"))
            {
                this._baseability.mp = this._baseability.maxMp;
            }
            _redNum.text = this._baseability.maxHp + "/" + this._baseability.maxHp;
            _blueNum.text = this._baseability.maxMp + "/" + this._baseability.maxMp;
            _redquad.scaleX = 1;
            _bluequad.scaleX = 1;
            _neiliNum.text = this._baseability.maxInnerPower + "/" + this._baseability.maxInnerPower;
            _neiliquad.scaleX = 1;
            if (this._buffability && this._buffability.hasOwnProperty("phyAtt"))
            {
                _txtphyAtt.text = this.numLine(this._baseability.phyAtt + Number(this._buffability.phyAtt), this._vipatt, this._vipattstr);
            }
            else
            {
                _txtphyAtt.text = this.numLine(this._baseability.phyAtt, this._vipatt, this._vipattstr);
            }
            if (this._buffability && this._buffability.hasOwnProperty("taoAtt"))
            {
                _txttaoAtt.text = this.numLine(this._baseability.taoAtt + Number(this._buffability.taoAtt), this._vipatt, this._vipattstr);
            }
            else
            {
                _txttaoAtt.text = this.numLine(this._baseability.taoAtt, this._vipatt, this._vipattstr);
            }
            if (this._buffability && this._buffability.hasOwnProperty("phyDef"))
            {
                _txtphyDef.text = this.numLine(this._baseability.phyDef + Number(this._buffability.phyDef));
            }
            else
            {
                _txtphyDef.text = this.numLine(this._baseability.phyDef);
            }
            if (this._buffability && this._buffability.hasOwnProperty("magicAtt"))
            {
                _txtmagicAtt.text = this.numLine(this._baseability.magicAtt + Number(this._buffability.magicAtt), this._vipatt, this._vipattstr);
            }
            else
            {
                _txtmagicAtt.text = this.numLine(this._baseability.magicAtt);
            }
            if (this._buffability && this._buffability.hasOwnProperty("magicDef"))
            {
                _txtmagicDef.text = this.numLine(this._baseability.magicDef + Number(this._buffability.magicDef));
            }
            else
            {
                _txtmagicDef.text = this.numLine(this._roleData.magicDef);
            }
            if (this._buffability)
            {
                _txtpureatk.text = this._baseability.pureatk + int(this._buffability.pureatk);
            }
            else
            {
                _txtpureatk.text = this._baseability.pureatk;
            }
            if (this._buffability)
            {
                _txtattackSpeed.text = this._baseability.attackSpeed + int(this._buffability.attackSpeed);
            }
            else
            {
                _txtattackSpeed.text = this._baseability.attackSpeed;
            }
            if (this._buffability)
            {
                _txtbaojiSpeed.text = this._baseability.critical + int(this._buffability.critical);
            }
            else
            {
                _txtbaojiSpeed.text = this._baseability.critical;
            }
            var _loc_1:* = UserData.getUserData();
            _redtxt.text = _loc_1.pkValue < 0 ? ("无") : (_loc_1.pkValue);
            var _loc_2:int = 0;
            if (this._baseability.luck >= 0)
            {
                _txtluck.text = this._baseability.luck;
                _txtunluck.text = "0";
            }
            else
            {
                _txtluck.text = "0";
                _txtunluck.text = String(-this._baseability.luck);
            }
            _txtaccurate.text = this._baseability.accurate;
            _txtdodge.text = this._baseability.dodge;
            _txtpkAtk.text = String(int(this._baseability.pkAtk) / 100) + "%";
            _txtpkDef.text = String(int(this._baseability.pkDef) / 100) + "%";
            _txtcritical.text = this._baseability.critdmg;
            var _loc_3:int = 0;
            var _loc_4:int = 0;
            _loc_3 = _loc_3 + int(this._baseability.pureatk);
            _loc_4 = _loc_4 + int(this._baseability.puredef);
            return;
        }// end function

        private function numLine(param1:Number, param2:Number = 0, param3:Number = 0) : String
        {
            var _loc_4:* = int(param1) * (param3 + 100) / 100 + param2;
            var _loc_5:* = param1 / Math.pow(2, 32) * (param3 + 100) / 100 + param2;
            return _loc_4 + " - " + _loc_5;
        }// end function

        private function getInfo(param1:Object, param2:int) : String
        {
            var _loc_3:String = "";
            if (param1.att > 0)
            {
                _loc_3 = _loc_3 + MColor.getHMTL("增加全攻击" + param1.att + "\n", param2);
            }
            if (param1.def > 0)
            {
                _loc_3 = _loc_3 + MColor.getHMTL("增加全防御" + param1.def + "\n", param2);
            }
            if (param1.luck > 0)
            {
                _loc_3 = _loc_3 + MColor.getHMTL("增加幸运" + param1.luck + "\n", param2);
            }
            if (param1.crit > 0)
            {
                _loc_3 = _loc_3 + MColor.getHMTL("增加暴击率" + param1.crit + "\n", param2);
            }
            if (param1.critrate > 0)
            {
                _loc_3 = _loc_3 + MColor.getHMTL("增加暴击伤害" + param1.critrate + "\n", param2);
            }
            if (param1.attackSpeed > 0)
            {
                _loc_3 = _loc_3 + MColor.getHMTL("增加攻速" + param1.attackSpeed + "\n", param2);
            }
            if (param1.accurate > 0)
            {
                _loc_3 = _loc_3 + MColor.getHMTL("增加准确" + param1.accurate + "\n", param2);
            }
            if (param1.dodge > 0)
            {
                _loc_3 = _loc_3 + MColor.getHMTL("增加敏捷" + param1.dodge + "\n", param2);
            }
            if (param1.hp > 0)
            {
                _loc_3 = _loc_3 + MColor.getHMTL("增加生命值" + param1.hp + "\n", param2);
            }
            if (param1.mp > 0)
            {
                _loc_3 = _loc_3 + MColor.getHMTL("增加魔法值" + param1.mp + "\n", param2);
            }
            if (param1.pureatk > 0)
            {
                _loc_3 = _loc_3 + MColor.getHMTL("增加混乱攻击" + param1.pureatk + "\n", param2);
            }
            if (param1.puredef > 0)
            {
                _loc_3 = _loc_3 + MColor.getHMTL("增加混乱防御" + param1.puredef + "\n", param2);
            }
            if (param1.attpercent > 0)
            {
                _loc_3 = _loc_3 + MColor.getHMTL("增加基础攻击" + param1.attpercent + "%\n", param2);
            }
            if (param1.defpercent > 0)
            {
                _loc_3 = _loc_3 + MColor.getHMTL("增加基础防御" + param1.defpercent + "%\n", param2);
            }
            if (param1.hppercent > 0)
            {
                _loc_3 = _loc_3 + MColor.getHMTL("增加基础生命值" + param1.hppercent + "%\n", param2);
            }
            if (param1.mppercent > 0)
            {
                _loc_3 = _loc_3 + MColor.getHMTL("增加基础魔法值" + param1.mppercent + "%\n", param2);
            }
            return _loc_3;
        }// end function

        private function getInfo1(param1:Object, param2:int) : String
        {
            var _loc_3:String = "";
            if (param1.csatk > 0)
            {
                _loc_3 = _loc_3 + MColor.getHMTL("增加传说装备最大攻击 " + param1.csatk + "%\n", param2);
            }
            if (param1.csdef > 0)
            {
                _loc_3 = _loc_3 + MColor.getHMTL("增加传说装备最大防御 " + param1.csdef + "%\n", param2);
            }
            if (param1.cshp > 0)
            {
                _loc_3 = _loc_3 + MColor.getHMTL("增加传说装备最大生命 " + param1.cshp + "%\n", param2);
            }
            if (param1.csmp > 0)
            {
                _loc_3 = _loc_3 + MColor.getHMTL("增加传说装备最大魔法 " + param1.csmp + "%\n", param2);
            }
            if (param1.cqatk > 0)
            {
                _loc_3 = _loc_3 + MColor.getHMTL("增加传奇装备最大攻击 " + param1.cqatk + "%\n", param2);
            }
            if (param1.cqdef > 0)
            {
                _loc_3 = _loc_3 + MColor.getHMTL("增加传奇装备最大防御 " + param1.cqdef + "%\n", param2);
            }
            if (param1.cqhp > 0)
            {
                _loc_3 = _loc_3 + MColor.getHMTL("增加传奇装备最大生命 " + param1.cqhp + "%\n", param2);
            }
            if (param1.cqmp > 0)
            {
                _loc_3 = _loc_3 + MColor.getHMTL("增加传奇装备最大魔法 " + param1.cqmp + "%\n", param2);
            }
            return _loc_3;
        }// end function

    }
}
